<template>
	<view class="cent">
		<div class="head">
			<div class="info">
				<image :src="userInfo.avatarUrl" mode=""></image>
				<span>{{userInfo.nickName}}</span>
			</div>
		</div>

		<van-tabs :active="active" :border="false" color="#005AAE" @click="getmybuy">
			<van-tab title="所有订单">
				<div class="list">
					<div v-for="(item,index) in orde" :key="index">
						<navigator url="" hover-class="none">{{item.pname}}</navigator>
						<p>{{item.createtime }}</p>
					</div>
					
				</div>

			</van-tab>

		</van-tabs>


		<quick />
	</view>
</template>

<script>
	import quick from '@/components/quick/index.vue'
	export default {
		components: {
			quick
		},
		data() {
			return {
				active: 0,
				userInfo:uni.getStorageSync('userInfo'),
				orde:[]
			};
		},
		onLoad(option) { //option为object类型，会序列化上个页面传递的参数
			this.active = Number(option.active)
			this.getmybuy()
		},
		onShareAppMessage(e){
			console.log('aaaaaaaaavvvvvvvvvv',e)
			return {
			  title: '你好，我是标题', // 转发标题
			  path: '/pages/my/order?id=123', // 当前页面 path ，必须是以 / 开头的完整路径
			  imageUrl: '@/static/my.png'
			}
		},
		methods: {
			phone() {
				wx.makePhoneCall({
					phoneNumber: '0755-86955985' //仅为示例，并非真实的电话号码
				})
			},
			getmybuy(){
				this.$api('/Api/tcc/getmybuy.html',{mid:121}).then(res=>{
					this.orde = res
				})
			}
		}
	}
</script>

<style lang="less">
	.cent {
		background: url(../../static/bg.jpg) no-repeat top;
		background-size: 100% 331rpx;
		min-height: 100vh;

		.head {
			height: 331rpx;
			text-align: center;

			.info {
				padding-top: 36rpx;

				image {
					width: 140rpx;
					height: 140rpx;
					border: 2rpx solid #fff;
					border-radius: 100%;
					background: #fff;
				}

				span {
					display: block;
					color: #fff;
					margin-top: 20rpx;
				}
			}
		}

		
		.list{
			padding: 30rpx 60rpx;
			div{
				padding: 30rpx 0;
				border-bottom: 1px solid #ddd;
				navigator{
					font-size: 24rpx;
					color: #666;
					font-weight: bold;
				}
				p{font-size: 18rpx;color: #666;margin-top: 50rpx;}
			}
		}
	}
</style>
